package LineCode.网易经典.test1;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt(); //房屋租金
        int f = sc.nextInt(); //水果个数
        int d = sc.nextInt(); //钱
        int p = sc.nextInt(); //水果p元
        int day = 0;

        //水果富足
        int xday = new Double(d/x).intValue();
        if (xday <= f)
            day = xday;
        //平分
        else {
            day = f;
            int yu = d - f*x;
            day += new Double(yu/(p+x)).intValue();
        }

        System.out.println(day);
    }
}